<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <style type="text/css">
        .nameClass
        {
            font-family:verdana;
            color:blue;
        }
        .addressClass
        {
            font-family:verdana;
            color:green;
        }
    </style>
    
    <title>Untitled Page</title>
   
    <script src="http://dev.virtualearth.net/mapcontrol/v4/mapcontrol.js" type="text/javascript"></script>
    
    <script type="text/javascript">
        
        var oMap = null;
        var pinID = 1;
        var addresses = new Array({0}); 
        var labels = new Array({1}); 
        var currentAddress = "";
        var currentLabel = "";
        var currentIndex = 0;
    
        function Main()
        {
            LoadAddresses();
        }
        
        function LoadAddresses()
        {
            oMap = new VEMap('Map');
            oMap.LoadMap();
            oMap.ShowDisambiguationDialog(false);
            
            if (addresses.length > 0)
            {
                FindAddress();
            }
        }
        
        function onFindResults(findResults)
        {
            var pinTitle;
            var pinDetails;
            var pin;
            
            if (findResults.length > 0)
            {
                pin = new VEPushpin( pinID, findResults[0].LatLong, null, currentLabel, currentAddress );
                oMap.AddPushpin(pin);
                pinID++;
            }
            
            FindAddress();
            
            oMap.SetZoomLevel(4);
        }
        
        function FindAddress()
        {
            if (currentIndex < addresses.length)
            {
                currentAddress = addresses[currentIndex];
                currentLabel = labels[currentIndex];
                oMap.Find(null, currentAddress, '1', onFindResults);
                currentIndex = currentIndex + 1;
            }
        }
    </script>
</head>
<body onload="Main();">

<div id="Map" style="position:relative; width:100%; height:100%;"></div>
    
</body>
</html>
